﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Super_Pong.BaseClasses;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Super_Pong.Classes
{
/*
Classe incompleta. Autor: João Vitor
NAO MECHER SEM AUTORIZAÇÃO DO AUTOR.
*/
    public class Bar : Entity
    {

        #region Attributes
        private Weapon slotLeft;
        private Weapon slotRight;
        private Thruster thruster;
        private Bouncer bouncer;
        #endregion

        #region Methods

        #region Constructor
        public Bar(Bouncer bc,Weapon lw,Weapon rw,Thruster th)
        {
            slotLeft = lw;
            slotRight = rw;
            thruster = th;
            bouncer = bc;
        }
        #endregion

        #region GetsAndSets

        //l returns the left weapon and r returns the right
        public Weapon GetWeapon(char slot)
        {
            if (slot == 'l')
                return slotLeft;
            else
                return slotRight;
        }

        public void SetWeapon(char slot, Weapon weapon)
        {
            if (slot == 'l')
                slotLeft = weapon;
            else
                slotRight = weapon; 
        }

        public Thruster GetThruster()
        {
            return thruster;
        }

        public void SetThruster(Thruster thruster)
        {
            this.thruster = thruster;
        }        

        public Bouncer GetBouncer()
        {
            return bouncer;
        }

        public void SetBouncer(Bouncer bouncer)
        {
            this.bouncer = bouncer;
        }
        #endregion



        public void Shoot(Vector2 target, Weapon slot)
        {
            slot.Shoot(target);
        }

        public override void Draw(SpriteBatch sb)
        {
            slotLeft.Draw(sb);
            slotRight.Draw(sb);
            //bouncer.Draw(sb);
        }

        public override void Update(GameTime elapsedTime)
        {
            //Update todos os sub objetos
        }

        //Move a barra pra cima
        public void MoveUp(float velocity)
        {
            move(getPosition(), velocity);
        }

        //Move a barra pra baixo
        public void MoveDown(float velocity)
        {
            move(getPosition(), -velocity);
        }

        public override void collide(Entity e)
        {
            //não faz nada
        }
        #endregion
    }
}
